package cn.com.shopec.erp.product.entity;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * 
 * @ClassName: Commodity1
 * @Description: 商品实体类
 * @author: duhui
 * @date 2013-5-29 下午02:55:44
 * 
 */
@Entity
@Table(name = "TBL_COMMODITY")
public class Commodity implements Serializable {

    /** id **/
    private String id;

    /** 商品编号 **/
    private String commoNo;

    /** 商品名称 **/
    private String commoName;

    /** 分类编号 **/
    private String catNo;

    /** 品牌编号 **/
    private String brandNo;

    /** 商品类型 (0:商品 1:赠品 2:免费货3:虚拟商品) **/
    private Integer commoType;

    /** 商品说明 **/
    private String description;

    /** 删除标志 (0:未删除 1:已删除) **/
    private Integer deleteFlag;

    /** 创建时间 **/
    private String createTime;

    /** 更新时间 **/
    private String updateTime;

    /** 审核状态0：未审核 1：已审核 2：已拒绝 **/
    private Integer checkState;

    /** 审核理由 **/
    private String checkReason;

    /** 商品对应的货品信息 **/
    private List<Product> products;
    
    @GenericGenerator(name = "generator", strategy = "uuid.hex")
    @Id
    @GeneratedValue(generator = "generator")
    @Column(name = "ID", unique = true, nullable = false, length = 32)
    public String getId() {
        return this.id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Column(name = "COMMO_NO")
    public String getCommoNo() {
        return this.commoNo;
    }

    public void setCommoNo(String commoNo) {
        this.commoNo = commoNo;
    }

    @Column(name = "COMMO_NAME")
    public String getCommoName() {
        return this.commoName;
    }

    public void setCommoName(String commoName) {
        this.commoName = commoName;
    }

    @Column(name = "CAT_NO")
    public String getCatNo() {
        return this.catNo;
    }

    public void setCatNo(String catNo) {
        this.catNo = catNo;
    }

    @Column(name = "BRAND_NO")
    public String getBrandNo() {
        return this.brandNo;
    }

    public void setBrandNo(String brandNo) {
        this.brandNo = brandNo;
    }

    @Column(name = "COMMO_TYPE")
    public Integer getCommoType() {
        return this.commoType;
    }

    public void setCommoType(Integer commoType) {
        this.commoType = commoType;
    }

    @Column(name = "DESCRIPTION")
    public String getDescription() {
        return this.description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Column(name = "DELETE_FLAG")
    public Integer getDeleteFlag() {
        return this.deleteFlag;
    }

    public void setDeleteFlag(Integer deleteFlag) {
        this.deleteFlag = deleteFlag;
    }

    @Column(name = "CREATE_TIME")
    public String getCreateTime() {
        return this.createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    @Column(name = "UPDATE_TIME")
    public String getUpdateTime() {
        return this.updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    @Column(name = "CHECK_STATE")
    public Integer getCheckState() {
        return this.checkState;
    }

    public void setCheckState(Integer checkState) {
        this.checkState = checkState;
    }

    @OneToMany(targetEntity = Product.class,fetch=FetchType.LAZY)
    @JoinColumn(name = "COMMO_NO", referencedColumnName = "COMMO_NO", insertable = false, updatable = false)
    public List<Product> getProducts() {
        return this.products;
    }

    public void setProducts(List<Product> products) {
        this.products = products;
    }

    @Column(name = "CHECK_REASON")
    public String getCheckReason() {
        return this.checkReason;
    }

    public void setCheckReason(String checkReason) {
        this.checkReason = checkReason;
    }

    
}
